<?php
FLEA::loadClass('FLEA_Db_TableDataGateway');

class Model_AdminProduct extends FLEA_Db_TableDataGateway
{
	var $tableName = 'product';
	var $primaryKey = 'id';

	var $hasOne = array(
		array('tableClass' => 'Model_Cert',
			'foreignKey' => 'product_id',
			'mappingName' => 'cert',
			'enabled' => false,
		),
		array('tableClass' => 'Model_ProduceCompany',
			'foreignKey' => 'product_id',
			'mappingName' => 'p_company',
			'enabled' => false,
		),
		array('tableClass'=>'Model_ProductSubitem',
			'foreignKey' => 'product_id',
			'mappingName' => 'subitem',
			'enabled' => false,
		),
	);

	var $belongsTo = array(
		array('tableClass' => 'Model_SysUsers',
			'foreignKey' => 'user_id',
			'mappingName' => 'user',
			'enabled' => false,
		),
	);

	function openDB($linkName){
		$this -> enableLink($linkName);
	}
	
}
?>